package com.logistics.utils.bean;

import com.logistics.utils.aspect.annotation.Dictionary;
import com.logistics.utils.constants.Constants;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class TabFilter {

    private String title;

    private String columnKey;

    private String type = "radio";

    private String defaultValue;

    private String value;

    private List<TabFilter> children;

    public static TabFilter build(String title,String columnKey, String type, String defaultValue, String value, List<TabFilter> children){
        TabFilter tabFilter = new TabFilter();
        tabFilter.setTitle(title);
        tabFilter.setColumnKey(columnKey);
        tabFilter.setType(type);
        tabFilter.setDefaultValue(defaultValue);
        tabFilter.setValue(value);
        tabFilter.setChildren(children);
        return tabFilter;
    };

    /**
     * PDA条件过滤器
     * @param title 画面展示名称
     * @param columnKey 组件标识
     * @param type 过滤器类型
     * @param value 勾选值
     * @return
     */
    public static TabFilter build(String title,String columnKey, String type,  String value){
        TabFilter tabFilter = new TabFilter();
        tabFilter.setTitle(title);
        tabFilter.setColumnKey(columnKey);
        tabFilter.setType(type);
        tabFilter.setValue(value);
        return tabFilter;
    };

    /**
     *用于定义PDA过滤器，勾选全部选项，
     *
     * @param title 用于指定PDA画面展示名称
     * @return
     */
    public static TabFilter unLimitFilter(String title){
        TabFilter tabFilter = new TabFilter();
        tabFilter.setTitle(title);
        tabFilter.setType(Constants.TABFILTER_TYPE_UNLIMIT);
        return tabFilter;
    }


}
